#ifndef CHDF5WRITE_H
#define CHDF5WRITE_H

#include "HDF5.h"

class CHDF5Write
{
public:
	CHDF5Write(const H5std_string& filename);//<Construction
	~CHDF5Write();///<Destruction
public:
	/*!
	* \brief This enum type 
	* create: write CHDF5 object to a new dataset or group. 
	* append: append CHDF5 object to an existing dataset or group.
	*/
	typedef enum accessType{create=0,append};

	int write(const H5std_string& location,CHDF5& chdf5,accessType accType=append);
//protected:
//	string m_ErrStr;
private:
	const H5std_string File_Name;///<HDF5 file name
	//const H5std_string Location;///<Location of the data set in the file
	//const char* Name; ///<Name to attach to the data set
	//CHDF5* DATASET; ///Dataset to in
	H5File* h5_file;

private:
	bool isDataSetExist(const H5std_string& location);
	bool isGroupExist(const H5std_string& location);
	void createGroups(vector<H5std_string>& paths);
	void createDataSet(CHDF5& chdf5,const H5std_string& location);
};
#endif